import { getNavApi } from '@/api/home'
export default {
  namespaced: true,
  state: {
    // 菜单分类列表
    cateList: []
  },
  mutations: {
    /**
     *
     * @param {*} state
     * @param {*} payload 调用setCateList传入的参数
     */
    setCateList (state, payload) {
      state.cateList = payload
    }
  },
  actions: {
    async getCateListAction ({ commit }, payload) {
      // commit('updateValue', payload)
      const { result } = await getNavApi()
      console.log('菜单分类数据：', result)
      commit('setCateList', result)
    }
  }
}
